﻿// <copyright file="GameComponentChangedEventArgs.cs" company="SingularityShift.com">
// Copyright (c) 2010 SingularityShift.com. All rights reserved.
// </copyright>
// <author>Ben McClure</author>
// <email>ben@singularityshift.com</email>
// <date>12/2/2010</date>
// <summary>Implements the game component changed event arguments class</summary>
namespace GameLib.Games.Util
{
    using System;

    using GameLib.Games.CompositeModel;

    /// <summary> Additional information for game component changed events. </summary>
    /// <remarks> Ben McClure, 12/2/2010. </remarks>
    public class GameComponentChangedEventArgs : EventArgs
    {
        /// <summary> 
        /// Initializes a new instance of the GameComponentChangedEventArgs class, specifying a 
        /// <see cref="GameComponentChangeType"/> signifying what has changed. 
        /// </summary>
        /// <remarks> This is a parameterless constructor that should only be used when you explicitly set the 
        /// <see cref="ChangeType"/> afterward. </remarks>
        /// <remarks> Ben McClure, 12/2/2010. </remarks>
        public GameComponentChangedEventArgs()
        {
        }

        /// <summary>
        /// Initializes a new instance of the GameComponentChangedEventArgs class, specifying a <see cref="GameComponentChangeType"/> signifying what has changed
        /// </summary>
        /// <param name="changeType">A <see cref="GameComponentChangeType"/> enum indicating what type of change was made</param>
        public GameComponentChangedEventArgs(GameComponentChangeType changeType)
        {
            this.ChangeType = changeType;
        }
        
        /// <summary>
        /// Initializes a new instance of the GameComponentChangedEventArgs class, specifying a <see cref="GameComponentChangeType"/> signifying what has changed, as well as including an attached value
        /// </summary>
        /// <param name="changeType">A <see cref="GameComponentChangeType"/> enum indicating what type of change was made</param>
        /// <param name="value">An object related to the change that was made</param>
        public GameComponentChangedEventArgs(GameComponentChangeType changeType, object value)
        {
            this.ChangeType = changeType;
            this.Value = value;
        }

        /// <summary> 
        /// Gets or sets an object related to the event.
        /// </summary>
        /// <remarks>
        /// <list type="bullet">
        /// <item>
        /// <description>In the case of an <see cref="IGameComponentCollection"/> being updated, the 
        /// <see cref="IGameComponent"/>in the list which has changed should be included.</description>
        /// </item>
        /// <item>
        /// <description>In the case of a value changing, the old value should be included.</description>
        /// </item>
        /// <item>
        /// <description>In the case of an <see cref="IGameComponentCollection"/> being reset, nothing needs to be
        /// included, and the value doesn't need to be specified. </description>
        /// </item>
        /// </list>
        /// </remarks>
        /// <value> The value to include (see Remarks). </value>
        public object Value
        {
            get;
            protected set;
        }

        /// <summary> 
        /// Gets or sets a <see cref="GameComponentChangeType"/> which indicates what type of change was made to the game.
        /// </summary>
        /// <remarks>
        /// The <see cref="GameComponentChangeType"/> should always be specified, or the event would not help the caller
        /// very much.
        /// </remarks>
        /// <value> The type of the change. </value>
        public GameComponentChangeType ChangeType
        {
            get;
            protected set;
        }
    }
}
